package com.maserb.monitor.entity.schoolNotice;

import com.maserb.monitor.entity.BaseIdEntity;
import com.maserb.monitor.entity.JwOrgEntity;

import javax.persistence.*;
import java.util.Date;

/**
 *  通知通告
 *  @author  jimmy
 */
@Entity
@Table(name = "school_notice")
public class SchoolNoticeEntity extends BaseIdEntity {
    /**
     * 班级或学校
     */
    private JwOrgEntity org;

    /**
     * 标题
     */
    private String title;

    /**
     * 内容
     */
    private String content;

    /**
     * 类型 1：学校通知 2：班级通知 3：学习通知 4：作业通知
     */
    private String type;

    private Date createTime;

    private String createUser;

    private Date updateTime;

    private String updateUser;

    private String fmtCreateTime;

    /**
     * 是否已读（0：未读  1：已读）
     */
    private String isRead;

    /**
     * 科目id
     */
    private String subjectId;


    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "org_id")
    public JwOrgEntity getOrg() {
        return org;
    }

    public void setOrg(JwOrgEntity org) {
        this.org = org;
    }

    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "content", length = 4000)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Column(name = "notice_type", length = 2)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "create_user", length = 20)
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "update_user", length = 50)
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Transient
    public String getFmtCreateTime() {
        return fmtCreateTime;
    }

    public void setFmtCreateTime(String fmtCreateTime) {
        this.fmtCreateTime = fmtCreateTime;
    }

    @Column(name = "is_read", length = 2)
    public String getIsRead() {
        return isRead;
    }

    public void setIsRead(String isRead) {
        this.isRead = isRead;
    }

    @Column(name = "subject_id", length = 32)
    public String getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(String subjectId) {
        this.subjectId = subjectId;
    }
}